<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/navigation_bar.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/common.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/posts.css') }}">
</head>
<body>

    <header>
        <nav class="nav-container">
            <div class="nav-left">
                <a href="#" class="nav-brand">论坛管理信息系统</a>
            </div>
            <div class="nav-center">
                <form class="nav-search" action="{{ url_for('search') }}" method="post">
                    <input type="text" placeholder="搜索..." class="search-input">
                    <button type="submit" class="search-button">搜索</button>
                </form>
            </div>
            <div class="nav-right">
                <a href="{{ url_for('list') }}" class="nav-link">首页</a>
                <a href="{{ url_for('detail') }}" class="nav-link">主页</a>
                <a href="{{ url_for('editor') }}" class="nav-link">发帖</a>
                <a href="{{ url_for('login') }}" class="nav-link">注销</a>
            </div>
        </nav>
    </header>
    <div class="container">
        <div class="left-column">
            <div class="profile-info">
                <h2>个人信息</h2>
                <p>昵称: {{ user[1] }}</p>
                <p>年龄: {{ user[2] }}</p>
                <p>邮箱: {{ user[4] }}</p>
                <a href="{{ url_for('send_message', recipient_id=user[0]) }}">发送消息</a>
            </div>
        </div>
        <div class="right-column">
            {% if user_posts %}
                {% for post in user_posts %}
                <div class="post-container">
                    <div class="post-header">
                        <h2 class="post-title">{{ post[1] }}</h2>
                        <div class="post-meta">
                            <div class="post-tags-container">
                                <span class="post-tags"><a href="{{ url_for('in_category', category = post[4]) }}">{{ post[4] }}</a></span>
                            </div>
                            <span class="post-author">帖主: <a href="{{ url_for('in_detail', user_id = user[0]) }}">{{ user[1] }}</a></span>
                            <span class="post-date">{{ post[2] }}</span>
                        </div>
                    </div>
                    <div class="post-content">
                        <p>{{ post[3] }}</p>
                    </div>
                    <div class="post-footer">
                        <a href="{{ url_for('in_post',  post_id=post[0]) }}" class="post-details-link">查看详情>></a>
                    </div>
                </div>
                {% endfor %}
            {% else %}
                <p>ta还没有发布任何帖子。</p>
            {% endif %}
        </div>
    </div>
</body>
</html>